package fr.emse.tatiana.replayable.analysis;

import java.util.List;

import fr.emse.tatiana.replayable.Anchor;

/**
 * This interface represents analyses which provide binary relationships
 * between events. These relationships are represented by Link
 * objects which encapsulate the anchors of the source and target
 * as well as the type of relationship.
 * 
 * @author dyke
 *
 */
public interface IGraphAnalysis extends IAnalysis {

	/**
	 * Get all the relationships for which an event is the source 
	 * 
	 * @param anchor of the event
	 * @return
	 */
	public List<Link> getSourceConnections(Anchor anchor);

	/**
	 * Get all the relationships for which an event is the target 
	 * 
	 * @param anchor of the event
	 * @return
	 */
	public List<Link> getTargetConnections(Anchor anchor);

	
	/**
	 * Delete a relationship
	 * 
	 * @param link
	 */
	public void removeLink(Link link);

	/**
	 * Notify that a relationshiop has been modified
	 * 
	 * @param link
	 */
	public void updateLink(Link link);
	
	/**
	 * Create a new relationship
	 * 
	 * @param source
	 * @param target
	 * @param type
	 * @param desc
	 */
	public void createLink(Anchor source, Anchor target, int type,
			String desc); 

	/**
	 * Get all the relationships in this analysis.
	 * 
	 * @return
	 */
	public List<Link> getLinks();

}